package com.ssy.lingxi.platform.template.service.controller.paas;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.platform.template.api.model.dto.paas.PageTemplatePAASDTO;
import com.ssy.lingxi.platform.template.service.service.paas.PageTemplatePAASService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @menu 页面模板 - （系统初始化）PAAS接口
 * @author fhj
 * @version 2.0.0
 * @date 2020/11/21
 */
@Api(tags = "页面模板 - （系统初始化）PAAS接口")
@RestController
@RequestMapping("/template/paas/pageTemplatePAAS")
public class PageTemplatePAASController {

    @Resource
    private PageTemplatePAASService pageTemplatePAASService;

    @ApiOperation(value = "新增")
    @PostMapping("/add")
    public Wrapper<Void> add(@RequestBody @Valid PageTemplatePAASDTO dto) {
        return pageTemplatePAASService.add(dto);
    }

    @ApiOperation(value = "修改")
    @PostMapping("/update")
    public Wrapper<Void> update(@RequestBody @Valid PageTemplatePAASDTO dto) {
        return pageTemplatePAASService.update(dto);
    }

    @ApiOperation(value = "使用")
    @PostMapping("/use")
    public Wrapper<Void> use(@RequestBody @Valid PageTemplatePAASDTO dto) {
        return pageTemplatePAASService.use(dto);
    }
}
